import React, { useState, useEffect, useContext} from 'react';

import {ThemeContext} from './createContext';

import Child from './child.jsx';

const View = (props)=>{

    const [themes,setThemes] = useState({
        foreground: '#ffffff',
        background: '#222222',
    })

    return(
        <div className="m">
            <h3>useContext</h3>
            <ThemeContext.Provider value={themes}>
                <Child>
                    <span>这是内容</span>
                </Child>
            </ThemeContext.Provider>
        </div>
    )
}

export default View;
